Spectroscopic pH measurement using optimized mixtures of reagents to extend measurement range

ABSTRACT

An indicator mixture that allows pH measurement over a broader range of pH or to a higher accuracy than available using conventional spectroscopic techniques. In particular, the mixture of the present invention is comprised of two or more reagents such that when combined, the reagent mixture is capable of either detecting: ( 1 ) a pH range broader or more accurate than that the reagents individually, or ( 2 ) pH more accurately than the reagents individually. Also disclosed are methods of making and using the mixture.

[0001] The present invention claims priority to co-pending U.S. patent application Ser. No. 10/667,639 filed Sep. 22, 2003, entitled “Determining Fluid Chemistry of Formation Fluid by Downhole Reagent Injection Spectral Analysis,” which in turn claims priority to co-pending GB patent application no. 0227267.2 filed Nov. 22, 2002, entitled “Apparatus and Method for Analysing Downhole Water Chemistry.” Both of these patent applications are incorporated by reference herein in their entireties.

FIELD OF THE INVENTION

[0002] The present invention relates to pH measurement of aqueous samples using pH sensitive reagents (such as dyes) and, more particularly, to a reagent mixture that allows accurate pH measurement over an extended measurement range.

BACKGROUND

[0003] Spectroscopic (or calorimetric) method for pH measurement is a well-established technique, wherein a pH sensitive reagent (or dye) changes color based on the pH of the solution. The theory of spectroscopic pH measurement using a single reagent indicator is well known (see Bates, “Determination of pH: Theory and Practice” Chapter 6 (1964), incorporated by reference herein in its entirety) and can be characterized by the following equation: $\begin{matrix} {{pH} = {{pKa} + {\log \quad \frac{\gamma_{B}}{\gamma_{A}}} + {\log \quad \frac{B}{A}}}} & (1) \end{matrix}$

[0004] where Ka is the thermodynamic acid dissociation constant for the reagent, which is a function of temperature and pressure; A, B are concentrations of the acid and base forms of the reagent, respectively; γ_(A), γ_(B) are activity coefficients of the acid and base forms of the reagent, respectively, which are a function of temperature, pressure and ionic strength of the solution.

[0005] The ratio of the base form to the acid form (B/A) of the reagent indicator may be calculated from spectral measurements using the following equations:

C _(T) =A+B  (2)

OD ^(λ1) =ε _(A) ^(λ1) lA+ε _(B) ^(λ1) lB  (3)

OD ^(λ2) =ε _(A) ^(λ2) lA+ε _(B) ^(λ2) lB  (4) $\begin{matrix} {{ODR}_{\lambda 1}^{\lambda 2} = \frac{{OD}^{\lambda 2}}{{OD}^{\lambda 1}}} & (5) \\ {\frac{B}{A} = \frac{{ODR}_{\lambda 1}^{\lambda 2}\left( {1 - {\frac{ɛ_{A}^{\lambda 2}}{ɛ_{A}^{\lambda 1}}\frac{1}{{ODR}_{\lambda 1}^{\lambda 2}}}} \right)}{\frac{ɛ_{B}^{\lambda 2}}{ɛ_{A}^{\lambda 1}}\left( {1 - {\frac{ɛ_{B}^{\lambda 1}}{ɛ_{B}^{\lambda 2}}{ODR}_{\lambda 1}^{\lambda 2}}} \right)}} & (6) \end{matrix}$

[0006] where OD^(λi) is the optical density measured at wavelength λ_(i); l is path length; A, B are the respective concentrations of acid and base forms of the reagent in the sample-reagent mixture; C_(T) is the total reagent concentration in the sample-reagent mixture; ε_(A) ^(λ1), ε_(B) ^(λi) are molar extinction coefficients at wavelength λ_(i) for A, B, respectively; and ODR_(λ1) ^(λ2) is the optical density ratio as defined in Equation (5).

[0007] The pH of a sample can be determined using spectral measurements by substituting Equation (6) in Equation (1). Because the acid and base form concentrations appear only as a ratio in Equation (1) and the absolute concentration of the reagent does not appear in Equations (1) or (5), the pH calculation is independent of the reagent concentration and the volume of the reagent added to the sample. If the ionic strength of the sample is at least an order of magnitude greater than the reagent concentration in the reagent-sample mixture, then the ionic strength of the sample and the activity coefficients (see Equations (7) and (8) below) are independent of reagent concentration. Accordingly, the only requirements for reagent addition are that the reagent concentration be (a) within a range where Beer's law is satisfied, (b) below an upper limit depending on the buffer strength of the sample beyond which the addition of the reagent could alter the sample pH, and (c) high enough to allow a good signal-to-noise ratio.

[0008] The molar extinction coefficients for the acid and base forms are obtained by calibration using solutions having pH values wherein the reagent exists completely in either its acid form or its base form. Alternatively, if the total reagent concentration is known very accurately, pH may be determined by measuring absorption at a single wavelength. However, because small errors in absolute concentration (C_(T)) can cause large errors in pH calculation, this method may not provide an accurate pH measurement. The pH of a sample may also be calculated using a continuous spectral scan in the relevant region and applying regression analysis to determine the base to acid ratio.

[0009] From Equation (1), as pH values move away from the pKa values of a given reagent, the acid or the base fraction of the reagent becomes very small. Due to the low signal-to-noise ratios, the error in the pH measurement increases as pH values move away from the pKa value. Thus, for example, for a pH value 2 units lower than the pKa value, the fraction of the base form of the reagent is only 1%. Consequently, the OD corresponding to the base form peak wavelength is very low, resulting in inadequate pH accuracy. With single reagent indicators, the typical range of pH measurement is limited to about 1 to 1.5 units on either side of the reagent's pKa value. Beyond this range, a different reagent with a more appropriate pKa value must be used. Accordingly, the spectroscopic technique is less flexible to implement because knowledge of the sample's pH range is required a priori so that the appropriate reagent indicator is selected.

[0010] A commonly used pH indicator uses a mixture of reagents to extend the range of pH measurement. Visual observation of color allows pH determination to within 1 unit (see Vogel, “Text-Book of Quantitative Inorganic Analysis” 3^(rd) Edition, Chapter 1.30, page 59 (1961), incorporated by reference herein in its entirety). However, it is difficult to obtain highly accurate measurements using spectroscopic techniques because the visible spectrum of the mixed reagent is generally a cumulative addition of the spectra of individual reagents. Unless the individual spectra are well resolved, it is difficult to invert the fraction of each form for accurate pH calculation.

[0011] Additional factors must be considered when performing pH analysis downhole. For example, only a limited number of reagents (pH indicators) can be transported downhole, the nature of the sample cannot be determined a priori, and only limited spectral analysis can be performed downhole. Accordingly, it would be useful to have a broad pH indicator that allows for simple, yet accurate, pH determination. Further, it is difficult to control the amount of reagent added to the sample under investigation in the downhole environment. Accordingly, a pH measurement that is not dependent on reagent concentration would be preferred.

[0012] Accordingly, it is an object of the present invention to provide an indicator mixture that retains the advantages of the single reagent method and that is effective over a broad range of pH values.

[0013] It is a further object of the present invention to provide a spectroscopic technique to determine the pH of a sample with the accuracy levels comparable to single reagent spectroscopy over a broad range of pH values.

[0014] It is yet another object of the present invention to provide a reagent mixture suitable for use in a downhole environment.

SUMMARY OF THE INVENTION

[0015] The present invention relates to the use of a reagent mixture that allows pH measurement over a broader range of pH than available using conventional spectroscopic techniques. In one embodiment of the present invention, a fluids analyzer for determining the pH of formation fluid in a region of earth formation surrounding a borehole is disclosed comprised of: a reagent container having a mixture of two or more reagents wherein the reagent mixture is capable of detecting either: (1) a pH range broader than each reagent individually or (2) pH more accurately than each reagent individually; and means for mixing formation fluid with the reagent mixture downhole. The fluids analyzer may further include a spectral analyzer means, coupled to receive a mixture of formation fluid and the reagent-mixture from the mixing means for analyzing the optical density of the mixture of formation fluid and reagent mixture in two or more spectral channels. The reagent mixture is capable of measuring pH to an accuracy of about 0.5 units or better. Typical downhole spectral analyzers use spectral channels having bandwidths of approximately 10-20 nm.

[0016] A second embodiment of the present invention is a method of making a reagent mixture for determining the pH of a sample comprising: (a) identifying a target pH range; (b) mixing known relative quantities of two or more reagents to create a reagent mixture, wherein the reagent mixture is capable of detecting either: (i) a pH range broader than each reagent individually or (ii) pH to a better accuracy than the reagents individually; (c) optimizing the reagent mixture to identify one or more sets of reagents to be mixed that satisfy the targeted pH range; and (d) characterizing at least one set of reagents.

[0017] The sets of reagents may be optimized by identifying one or more sets of reagents by carefully selecting the thermodynamic acid dissociation constants of the reagents, adjusting the relative quantities of the reagents, or adjusting (the bandwidth and/or wavelength of) the spectral channels. This optimization process may be performed by trial and error, or experimentation. It is noted that in some cases optimization may be generally viewed as an error minimization technique; however, optimization may be performed to improve other parameters of interest, such as maximizing sensitivity of pH measurement or signal-to-noise ratio. Alternatively, forward models and algorithms may be developed based on thermodynamic acid dissociation constants, relative quantities (or fractions), and the spectral channels. Once “optimal” reagent sets are identified, at least one of the sets should be characterized to determine the detectable pH range of the mixture. Further, an error analysis should be performed to determine the accuracy of the mixture to measure pH. It is further noted that the absolute concentration of the reagent mixture may be optimized to improve signal-to-noise ratio and reduce the effects of error.

[0018] In a third embodiment, a method for determining the pH of formation fluid in a region of earth formation surrounding a borehole is disclosed comprising: (a) storing a reagent mixture in a reagent container coupled to a fluids analyzer, wherein the reagent mixture is capable of detecting either: (i) a pH range broader than each reagent individually or (ii) pH to a better accuracy than each reagent individually; (b) positioning the fluids analyzer downhole; (c) drawing formation fluid into the fluids analyzer; (d) mixing formation fluid and the reagent mixture; and (e) analyzing the optical density of said mixture of formation fluid and reagent mixture in one or more channels to determine the pH of the formation fluid. If only one spectral channel is used, the absolute concentration of the reagent mixture should also be determined. However, if two spectral channels are used, then it is not necessary to determine the absolute concentration of the reagent mixture.

[0019] Accordingly, the present invention provides a pH indicator mixture for spectroscopic techniques that is accurate over a broader pH range (as compared to conventional spectroscopic methods). As will be described in detail below, the method disclosed herein uses either (1) two or more spectral channels or (2) one spectral channel and accurate (absolute) reagent concentrations. If optical density (OD) measurements (or transmission, absorption or other spectral measurements which may be converted to OD) at two spectral channels are used, reagent concentration in the sample-reagent mixture is not needed; instead the relative quantities (fractions) of the reagent in the mixture may be used. Furthermore, the reagents need not have well resolved individual spectra. In fact, the accuracy of the method is enhanced if the spectra of the acid and base forms of one reagent are substantially similar to the spectra of the acid and base forms of the other, respectively. Because there is a vast pool of reagents to choose from, it is relatively simple to pick reagents that show similar direction of color change with pH though at different pKa values. Accordingly, the present invention includes algorithms to optimize for the choice of reagents (i.e., their pKa values) based on the pH measurement range of interest. Further, the individual reagent fractions in the mixture may be selected to obtain an optimized mixture over the pH range of interest. It is noted that while the discussion that follows relates to the use of two reagents, the method may be easily extended to three or more reagents.

[0020] For the purposes of the present invention, the term “optical techniques” is intended to apply to a broad range of techniques, including but not limited to, spectroscopic, calorimetric, optical, etc. It is further noted that for the purposes of the present invention, the terms “pH sensitive reagent,” “reagent,” and “dye indicator” are used interchangeably.

[0021] Further advantages and novel features of the invention will be set forth in the description which follows.

BRIEF DESCRIPTION OF THE DRAWINGS

[0022]FIG. 1 is a plot showing the spectra of a three-reagent mixture in buffer solution with pH varying from 3 to 9.

[0023] FIGS. 2(a) and (b) are plots: (a) comparing model predicted pH from experimental ODR values of FIG. 1 with true buffer pH values (445 and 570 nm wavelengths) and (b) showing the error in pH measurements as a function of pH.

[0024] FIGS. 3(a) and (b) are plots: (a) showing a scenario where the acid form spectra of one reagent is identical to the base form spectra of the other and vice versa resulting in the pH being a non-unique function of ODR and (b) showing that pH is a unique function of ODR even when the acid and base forms of the two reagents have identical spectra.

[0025]FIG. 4 is a plot showing the error estimation for single and two-reagent mixtures, allowing estimation of target pH intervals for any desired accuracy level (see Table 2 below).

[0026]FIG. 5 is a plot showing the effect of changing the power p in the objective function [see Equation (30) below].

[0027]FIG. 6 is a plot showing that the optimization of the mole fractions in the three-reagent mixture yields better accuracy over the pH interval 4-9 as compared to using equal mole or weight quantities.

[0028]FIG. 7 is a plot showing the change in optimum reagent quantities with change in the target pH interval.

[0029]FIG. 8 is a plot showing the determination of the optimum pKa values for an equal weight mixture of three-reagents for various target pH intervals by optimizing objective function Equation (30) below.

[0030] FIGS. 9(a) and (b) are schematics describing the overall optimization algorithm.

[0031]FIG. 10 is a schematic showing one application of the present invention.

DETAILED DESCRIPTION

[0032] The present invention relates to a spectroscopic technique accurate over a broader pH range (as compared to conventional spectroscopic methods) using reagent mixtures. As will be described in detail below, the method disclosed herein uses either (1) two or more spectral channels or (2) one spectral channel and accurate reagent concentrations. If two spectral channels are analyzed, reagent concentration in the sample-reagent mixture is not needed; instead the relative quantities (fractions) of the reagent in the mixture may be used. Furthermore, the reagents need not have well resolved individual spectra. In fact, the accuracy of the method is enhanced if the spectra of the acid and base forms of one reagent are substantially similar to the spectra of the acid and base forms of the other, respectively. Because there is a vast pool of reagents to choose from, it is relatively simple to pick reagents that show similar direction of color change with pH though at different pKa. Accordingly, the present invention includes algorithms to optimize for the choice of reagents (i.e., their pKa values) based on the pH measurement range of interest. Further, the individual reagent fractions in the mixture may be selected to obtain an optimized mixture over the pH range of interest. It is noted that while the discussion that follows relates to the use of two reagents, the method may be easily extended to three or more reagents.

[0033] Equations (1) through (6) may be rewritten for two reagents as follows: $\begin{matrix} {{pH} = {{pKa}_{1} + {\log \quad \frac{\gamma_{B1}}{\gamma_{A1}}} + {\log \frac{B_{1}}{A_{1}}}}} & (7) \\ {{pH} = {{pKa}_{2} + {\log \quad \frac{\gamma_{B2}}{\gamma_{A2}}} + {\log \frac{B_{2}}{A_{2}}}}} & (8) \end{matrix}$

 C _(T1) =A ₁ +B ₁  (9)

C _(T2) =A ₂ +B ₂  (10) $\begin{matrix} {f_{1} = \frac{C_{T1}}{C_{T1} + C_{T2}}} & (11) \end{matrix}$

 OD ^(λ1) =ε _(A1) ^(λ1) lA ₁ +ε _(B1) ^(λ1) lB ₁ +ε _(A2) ^(λ1) lA ₂ +ε _(B2) ^(λ1) lB ₂  (12)

OD ^(λ2) =ε _(A1) ^(λ2) lA ₁ +ε _(B1) ^(λ2) lB ₁ +ε _(A2) ^(λ2) lA ₂ +ε _(B2) ^(λ2) lB ₂  (13) $\begin{matrix} {{ODR}_{\lambda 1}^{\lambda 2} = \frac{{OD}^{\lambda 2}}{{OD}^{\lambda 1}}} & (14) \end{matrix}$

[0034] where A₁, B₁ are acid and base form concentrations, respectively, of reagent 1 in the sample-reagent mixture; A₂, B₂ are acid and base form concentrations, respectively, of reagent 2 in the sample-reagent mixture; C_(T1), C_(T2) are total concentrations of reagent 1 and reagent 2, respectively, in the sample-reagent mixture; ƒ₁ is the mole fraction of reagent 1 in the reagent mixture; pKa₁, pKa₂ are dissociation constants for reagents 1 and 2, respectively.

[0035] From Equations (7) through (14): $\begin{matrix} {{{ODR}_{\lambda 1}^{\lambda 2} = {{\frac{\sum\limits_{i}{\frac{B_{i}}{B_{1}}\frac{ɛ_{Bi}^{\lambda 2}}{ɛ_{B1}^{\lambda 2}}\left( {1 + {\frac{ɛ_{Ai}^{\lambda 2}}{ɛ_{Bi}^{\lambda 2}}10^{- {({{p\quad H} - {pKa}_{i}})}}}} \right)}}{\sum\limits_{i}{\frac{B_{i}}{B_{1}}\frac{ɛ_{Ai}^{\lambda 1}}{ɛ_{Bi}^{\lambda 2}}\frac{ɛ_{Bi}^{\lambda 2}}{ɛ_{B1}^{\lambda 2}}\left( {10^{- {({{p\quad H} - {pKa}_{i}})}} + \frac{ɛ_{Bi}^{\lambda 1}}{ɛ_{Ai}^{\lambda 1}}} \right)}}\quad {for}\quad i} = 1}},2} & (15) \end{matrix}$

[0036] where $\begin{matrix} {\frac{B_{2}}{B_{1}} = {\frac{1 + 10^{{- {({{p\quad H} - {pKa}_{1}})}}\quad}}{{1 + 10^{- {({{p\quad H} - {pKa}_{2}})}}}\quad}\frac{\left( {1 - f_{1}} \right)}{f_{1}}}} & (16) \end{matrix}$

[0037] Hence:

ODR _(λ1) ^(λ2)=ƒ(pH, ε, pKa ₁ , pKa ₂ , ƒ ₁)  (17)

[0038] where

ε=(ε_(A1) ^(λ1),ε_(B1) ^(λ1),ε_(A1) ^(λ2),ε_(B1) ^(λ2),ε_(A2) ^(λ1)ε_(B2) ^(λ1),ε_(A2) ^(λ2),ε_(B2) ^(λ2))  (18)

[0039] From Equation (17), which is an analytical equation, once the reagents for the two-reagent mixture are chosen, the relative quantities, and wavelengths (width of the spectral channel) are selected, the ODR becomes a function only of the pH. It is independent of absolute reagent concentrations or volume of reagent mixture added to sample, and therefore retains the advantage of the single reagent measurement. The mixture may be characterized in terms of ODR and pH such that plots and look-up tables may be generated. Alternatively, Equation (17) may be inverted to express pH as an analytical function of ODR (such as by using a program like Mathematica by Wolfram Research, Inc.):

pH=ƒ(ODR _(λ2) ^(λ2) ,ε, pKa ₁ , pKa ₂ ,ƒ ₁)  (19)

[0040] Equations (7) through (19) can be extended to a system of n reagents: $\begin{matrix} {{{ODR}_{\lambda 1}^{\lambda 2} = {{\frac{\sum\limits_{i}{\frac{B_{i}}{B_{1}}\frac{ɛ_{Bi}^{\lambda 2}}{ɛ_{B1}^{\lambda 2}}\left( {1 + {\frac{ɛ_{Ai}^{\lambda 2}}{ɛ_{Bi}^{\lambda 2}}10^{- {({{p\quad H} - {pKa}_{i}})}}}} \right)}}{\sum\limits_{i}{\frac{B_{i}}{B_{1}}\frac{ɛ_{Ai}^{\lambda 1}}{ɛ_{Bi}^{\lambda 2}}\frac{ɛ_{Bi}^{\lambda 2}}{ɛ_{B1}^{\lambda 2}}\left( {10^{- {({{p\quad H} - {pKa}_{i}})}} + \frac{ɛ_{Bi}^{\lambda 1}}{ɛ_{Ai}^{\lambda 1}}} \right)}}\quad {for}\quad i} = 1}},n} & (20) \\ {{\frac{B_{i}}{B_{1}} = {{\frac{1 + 10^{{- {({{p\quad H} - {pKa}_{1}})}}\quad}}{{1 + 10^{- {({{p\quad H} - {pKa}_{i}})}}}\quad}\frac{f_{i}}{f_{1}}\quad {for}\quad i} = 1}},n} & (21) \end{matrix}$

 ODR _(λ1) ^(λ2)ƒ(pH,ε,pKa ₁ ,pKa ₂ . . . pKa _(n) ,ƒ ₁ , ƒ ₂ . . . ƒ _(n))  (22)

[0041] where:

ε(ε_(A1) ^(λ1),ε_(B1) ^(λ1),ε_(A1) ^(λ2),ε_(B1) ^(λ2),ε_(A2) ^(λ1),ε_(B2) ^(λ1),ε_(A2) ^(λ2),ε_(B2) ^(λ2), . . . ε_(An) ^(λ1),ε_(Bn) ^(λ1),ε_(An) ^(λ2),ε_(Bn) ^(λ2))  (23)

[0042] Hence:

pH=ƒ(ODR _(λ1) ^(λ1) ,ε, pKa ₁ , pKa ₂ . . . pKa _(n) , ƒ ₁ ,ƒ ₂ . . . ƒ _(n))  (24)

[0043] It is noted that Equations (22) and (24) are analytical expressions.

[0044]FIG. 1 shows experimentally measured spectra for a three-reagent mix in pH buffers 3-9. Arrow A indicates decrease in OD of acid forms of reagents as buffer pH increases from 3 to 9. Arrow B indicates increase in OD of base forms of the reagents as buffer pH increases from 3 to 9. Reagent properties of these mixtures are summarized in Table 1.

[0045]FIG. 2(a) compares model predicted pH values calculated using measured ODR values of FIG. 1 with true pH values of the buffer solutions. FIG. 2(b) plots the experimental error at various pH values. The reagent mixture of the example of FIG. 2(b) is accurate over the range of buffers used (pH 3-9) with the errors within 0.06 pH units. Accordingly, the reagent mixture of the present invention is accurate over a broader pH range than the traditional single reagent indicators, which typically work over 2-3 pH units (see, for example, Table 2 below). TABLE 1 Summary of reagent properties used in simulations Phenol Red Chlorophenol Red Bromophenol Blue (reagent 1) (reagent 2) (reagent 3) Acid Base* Acid Base* Acid Base* ε at 570 nm (λ₂) 108 37975 58 54247 378 46859 ε at 445 nm (λ₁) 17916 3352 18136 1985 21711 1981 Mol. wt. 354.38 376.36 423.28 445.26 669.98 691.97 pKa 7.79 6.11 4.11

[0046] The pH as calculated from Equation (24), however, is not necessarily always a unique function of ODR. FIG. 3(a) is a plot showing two reagents (pKa₁=7.79, pKa₂=6.11,ƒ₁=0.5) that are exact mirror images of each other; in this example, the spectrum of the acid form of one reagent is identical to the spectrum of the base form of the second reagent and vice versa (ε_(A1) ^(λj)=ε_(B2) ^(λj);ε_(A2) ^(λj)=ε_(B1) ^(λj) for all j). For each pH value there is a unique ODR. However, the inverse is not true; for a given ODR, there are two pH values and the method fails. By choosing reagents that show common direction of color change with pH (but at different pKa values), the sensitivity of the pH to ODR may be increased to obtain a unique solution.

[0047]FIG. 3(b) shows the pH vs. ODR plot for two reagents (pKa₁=7.79, pKa₂=6.11, ƒ₁=0.5) with identical spectra for its acid and base forms (ε_(A1) ^(λj)=ε_(A2) ^(λj);ε_(B1) ^(λj)=ε_(B) ^(λj) for all j). Here, the present invention works well. These results are contrary to conventional thinking where good spectral resolution would be preferred to calculate pH by inverting the spectra of the mixture for acid and base fractions of each reagent.

[0048] Like the single reagent measurement, the mixture of the present invention is independent of total amount of reagent added to the sample. Accordingly, the present methodology is easy to implement in batch or flow injection mode for measuring pH of aqueous samples. The method uses (1) a minimum of two spectral channels if concentration independence is desired or (2) one spectral channel and accurate reagent concentrations. The latter is very sensitive to absolute reagent concentrations and, hence, is potentially less robust. Alternatively, pH may be calculated using regression analysis, if spectral absorption (OD) data at more than two wavelengths or continuous scans are available.

[0049] Error Propagation and Analysis in pH Measurement

[0050] As mentioned above, a single reagent is sensitive only over a limited pH range around its pKa value. The extent of this range is determined by the accuracy required in the pH measurement and the spectroscopic noise. An error analysis should be performed to determine the measurable range as a function of these two parameters for single reagents and mixed reagents. An error analysis can also be performed to optimize for one or more of: the choice of reagents, relative quantities of the reagents, or spectral channels.

[0051] The method of error propagation is used to determine the standard deviation in pH measurement as a function of spectroscopic noise (standard deviation in OD) (Bevington et al., “Data Reduction and Error Analysis for the Physical Sciences,” 3^(rd) Edition, Chapter 3, pages 36-41, (2003), incorporated by reference herein in its entirety).

[0052] For x=ƒ(u,v), the standard deviation in x (σ_(x)) as a function of standard deviations in u (σ_(u)) and ν(σ_(v)) is given as: $\begin{matrix} {\sigma_{x} \cong \sqrt{{\sigma_{u}^{2} \cdot \left( \frac{\partial x}{\partial u} \right)^{2}} + {\sigma_{v}^{2} \cdot \left( \frac{\partial x}{\partial v} \right)^{2}}}} & (25) \end{matrix}$

[0053] For a given reagent mixture (fixed pKa_(i), ε, ƒ_(i)) and for a given set of wavelengths (λ₁, λ₂), the error propagation algorithm may be applied to Equations (20) and (24): $\begin{matrix} {\sigma_{{ODR}_{\lambda 1}^{\lambda 2}} = {{ODR}_{\lambda 1}^{\lambda 2} \cdot \sqrt{\left( \frac{\sigma_{OD}^{\lambda 2}}{{OD}^{\lambda 2}} \right)^{2} + \left( \frac{\sigma_{OD}^{\lambda 1}}{{OD}^{\lambda 1}} \right)^{2}}}} & (26) \\ {\sigma_{p\quad H} = {\frac{\partial{pH}}{\partial{ODR}_{\lambda 1}^{\lambda 2}} \cdot \sigma_{{ODR}_{\lambda 1}^{\lambda 2}}}} & (27) \end{matrix}$

[0054] Combining Equations (26) and (27), standard deviation in pH (σ_(pH)) measurement is obtained as a function of spectroscopic noise at the two wavelengths λ₁ and λ₂: $\begin{matrix} {\sigma_{p\quad H} = {\frac{{\partial p}\quad H}{\partial{ODR}_{\lambda 1}^{\lambda 2}} \cdot {ODR}_{\lambda 1}^{\lambda 2} \cdot \sqrt{\left( \frac{\sigma_{{OD}^{\lambda 2}}}{{OD}^{\lambda 2}} \right)^{2} + \left( \frac{\sigma_{{OD}^{\lambda 1}}}{{OD}^{\lambda 1}} \right)^{2}}}} & (28) \end{matrix}$

[0055] The derivative of pH with respect to ODR may be determined using the analytical expression of Equation (24) (which may be determined by inverting Equation (22) (such as by using packages such as Mathematica by Wolfram Research, Inc.).

[0056] Alternatively, because the expression is very long, the derivative from Equation (22) may be numerically calculated provided ODR is a continuous function of pH and differentiable at every point in the interval of interest. $\begin{matrix} {\frac{{\partial p}\quad H}{\partial{ODR}_{\lambda 1}^{\lambda 2}} = \frac{1}{\frac{\partial{ODR}_{\lambda 1}^{\lambda 2}}{{\partial p}\quad H}}} & (29) \end{matrix}$

[0057]FIG. 4 compares the standard deviation in pH as a function of standard deviation in OD (where spectroscopic noise is assumed to be 0.01 OD units and C_(T) is 2×10⁻5 M) for single reagents and for equal weight fraction mixture of the two reagents, PR and CPR from Table 1. This figure allows the measurable pH range to be estimated for a desired accuracy as a function of spectroscopic noise. Accordingly, the two-reagent mixture of this example allows measurement over a range longer than the single reagents mixtures (see also Table 2). It is noted that the addition of a third reagent will allow further extension of the measurement range. TABLE 2 Extending range of pH measurements with reagent mixtures for 0.1 pH unit desired accuracy assuming spectroscopic noise of 0.01 OD units Reagent Mole Fraction (f₁, f₂, f₃) C_(T), [M] pH range PR 1.0, 0.0, 0.0 2 × 10⁻⁵ 6.6-8.7 CPR 0.0, 1.0, 0.0 2 × 10⁻⁵ 4.7-7.0 BB 0.0, 0.0, 1.0 2 × 10⁻⁵ 2.8-5.1 PR-CPR 0.55, 0.45, 0.0 2 × 10⁻⁵ 5.1-8.2 (equal weight fractions) PR-CPR 0.55, 0.45, 0.0 4 × 10⁻⁵ 4.8-8.6 (equal weight fractions) PR-CRP-BB 0.42, 0.35, 0.23 2 × 10⁻⁵ 3.6-7.9 (equal weight fractions) PR-CRP-BB 0.46, 0.26, 0.28 2 × 10⁻⁵ 3.5-8.1 (optimized for pH 3.5 to 8) PR-CRP-BB 0.42, 0.35, 0.23 4 × 10⁻⁵ 3.2-8.5 (equal weight fractions)

[0058] From Equation (28), assuming equal noise at two wavelengths (σ_(OD) _(^(λ1)) =σ_(OD) _(^(λ2)) =σ_(OD)), σ_(pH) increases linearly with σ_(OD). Note also that while the pH calculation is independent of absolute reagent concentrations, the error in the pH measurement depends on absolute reagent concentration through the absolute OD values that appear in Equation (28). For a given reagent mixture with a fixed relative quantity of the individual reagents, the error in pH, σ_(pH), decreases linearly with increasing absolute reagent concentration. However, as explained above, if concentration of the reagents added is very high, then concentration could affect the pH of the sample and introduce additional errors. Furthermore, the concentration may go beyond the range where Beer's Law is valid.

[0059] Optimization of Reagent Mixtures

[0060] Using the error estimation algorithm described above, the reagent mole fraction in the mixture may be optimized to minimize the error over a desired pH range. A possible formulation for the objective function for desired accuracy of 0.1 pH units, for example, over the interval pH₁ to pH₂, could include: $\begin{matrix} {{{Minimize}\quad {F\left( {f_{1},f_{2},\quad {\ldots \quad f_{n}}} \right)}} = {{\sum\limits_{i = 1}^{m}\quad {{w_{i}\left( {\sigma_{p\quad H_{i}} - 0.1} \right)}^{p}\quad {for}\quad {all}\quad \sigma_{p\quad H_{i}}}} \geq 0.1}} & (30) \end{matrix}$

[0061] where m is the number of discrete points into which the interval between pH₁ and pH₂ is divided and w_(i) is the weight applied to the error contribution at each point. Both w_(i) and p may be chosen to adjust the contribution of the error at each pH value in the desired range. This method provides the flexibility of having different levels of accuracy within a broader constraint of 0.1 pH units error. For example, by assigning a higher weight to the points in the interval between 5 and 6, one can optimize for 0.1 unit accuracy over the entire range of 4 to 9 with a higher level of accuracy between 5 and 6.

[0062]FIG. 5 shows the effect of varying power p with w_(i) equal to one when optimizing over a pH range of 4-9 for a three-reagent mixture (reagent properties are summarized in Table 1). At pH equal to 9, the deviation from 0.1 units is very high. By using a power of 1, the contribution of error at 9 to the objective function Equation (30) is 0.27 units and is about 9 times higher than the contribution of the error at pH 5 (0.03 units). However, if the power p is 0.2, the contribution to the objective function of the error at pH 9 (0.77 units) is only 1.54 times higher as compared to the objective function error at pH 5 (0.5 units). In the second case with power p equal to 0.2, the optimization algorithm gives nearly equal importance to minimizing the error at pH 5 and pH 9, while in the first case the pH 9 error term dominates and the optimization algorithm ignores the error at pH 5. This is evident in the plots for the two cases.

[0063] While this is one form of the optimization function, one skilled in the art would recognize that other algorithms may be used to optimize reagent mixtures.

[0064] Standard minimization routines (such as the non-gradient simplex or amoeba DUMPOL algorithm in IMSL package from Visual Numerics, Inc.) can be used for the optimization of reagent mole fractions in the mixture.

[0065]FIG. 6 shows the results of a three-reagent mixture optimized for pH range of 4 to 9 and compares with cases when equal weight and equal mole fractions are used. [Spectroscopic noise is assumed to be 0.01 OD units and total reagent concentration is 2×10⁻5 M. For Equation (30), p is 0.5 and w_(i) is 1.]

[0066]FIG. 7 shows how the optimization algorithm (see Equation (30)) adjusts mole fractions of the reagents in the mixture as the pH range of interest changes. As the pH range (pH 4-9) is shifted to a smaller interval of pH 6-9, the fraction of the reagent 1 (pKa=7.79) increases, while that of reagent 3 (pKa=4.11) falls to zero. [Spectroscopic noise is again assumed to be 0.01 OD units and total reagent concentration is 2×10⁻5 M. For Equation (30), p is 0.5 and w_(i) is 1.]

[0067] As discussed above, it is possible to obtain reagent combinations where the pH is a non-unique function of ODR. To prevent this, it is recommended that when a set of reagents are chosen, the mixture is forward modeled with known relative quantities or mole fractions of reagents to calculate pH as a function of ODR. The plot can be visually inspected or algorithms may be used to inspect the pH values to check for uniqueness. Generally, it is expected that when reagents in the mixture have different pKa values but their acid and base forms show similar color transformations with pH (for example, colors of all reagents changing from yellow to blue/red as they go from acid to base), the reagent combination should provide a unique pH vs. ODR plot.

[0068] It is also possible to optimize the reagent selection process (with a final check being done as discussed above for uniqueness). Thus, for a fixed mole fraction, pKa values of the reagents in the mixture may be optimized so as to maximize accuracy in the pH interval of interest. FIG. 8 lists optimum sets of pKa values of reagents in a three-reagent mixture for different pH intervals of interest. [For Equation (30), p is 0.5 and wi is 1.] For this example, the three-reagents had equal weight fractions, and epsilon values were fixed as provided in Table 1.

[0069] Reagents may also be chosen to allow pH measurement over discontinuous pH intervals of interest. Thus, in a two-reagent mixture of phenol red (pKa=7.79), for example, and bromophenol blue (pKa=4.11) where the pKa values are separated by more than 3 units, the pH intervals on the low end (2.8-5.1 units) and the high end (6.6-8.7) may be simultaneously targeted without any sensitivity for regions in between.

[0070] The general method of making and optimizing the pH indicator mixture is described in FIGS. 9(a) and (b). As shown in FIG. 9(a), first a target pH range is selected 900. Then, known relative quantities of the two or more reagents are mixed 910. The reagents are selected such that when mixed, the reagents cover a broader pH range or improved accuracy than if the reagents were used individually. It is noted that the present method does not require that absolute concentrations of the reagents be known; knowledge of relative (or fractional) quantities is sufficient. The reagent mixture is then optimized (for example, by trial and error, experimentation, or using forward modeling) to identify one or more sets of reagents that satisfy the target pH range 920. Once optimized reagent sets are identified, one or more of the reagent sets may be characterized to be used for spectroscopic pH measurement 930 (such as by developing functions of pH, OD, ODR, error deviations, etc.).

[0071] A non-limiting preferred algorithm is shown in FIG. 9(b). As in FIG. 9(a), a pH target range is identified 900 and known quantities of two or more reagents are mixed 910. Boxes 920 a-920 _(f) describe a preferred method of optimizing the reagent mixtures. First, a forward model is developed 920 a based on the three variables: (1) the thermodynamic acid dissociation constants which are dependent on the reagents selected; (2) the relative quantities of the reagents (it may be simplest to begin with equal quantities of reagents); and (3) the identification of two or more spectral channels wherein the reagents show elevated levels of optical densities. It may be preferred to identify common channels wherein all of the reagents show elevated levels of optical density. Next, an algorithm is developed 920 b based on the forward model of 920 a to identify sets of reagents having optimized thermodynamic acid dissociation constants. (It is noted that reagents having the exact thermodynamic acid dissociation constants as optimized may not be available. Accordingly, an “optimized” reagent set will include reagents have thermodynamic acid dissociation constants within acceptable range of the optimal value. Accordingly, numerous acceptable reagent sets may be identified.)

[0072] The procedure is then repeated for the optimized set of reagents 920 c-920 d using the optimized thermodynamic acid dissociation constants, relative weight fractions, and spectral channels. However, now the reagent sets are optimized to determine the optimal relative weight fractions for the reagent sets identified in 920 b. The procedure is repeated once more for the optimized set of reagents 920 e-920 f using the optimized thermodynamic acid dissociation constants, the optimized relative weight fractions, and spectral channels. But, now the reagent sets are optimized to determine the optimal spectral channels for the reagent sets identified in 920 d.

[0073] It is noted that each level of optimization need not be performed. One may chose to optimize for one or more (but not necessarily all) of: the thermodynamic equilibrium constants, relative quantities, or spectral channels at any time as shown by the dotted arrow to the left. At any point in the process, the optimized reagent sets may be checked for a unique correlation of pH as a function of ODR 930 a and characterized for later use for spectroscopic pH measurement 930 b. It is noted that the absolute concentration of the reagent mixture may also be adjusted to improve error (i.e., the signal to noise ratio.)

[0074] Apparatus Example

[0075] The present invention may be implemented in a laboratory or in various downhole fluid analysis tools. For example, the apparatus described in commonly owned co-pending U.S. patent application Ser. No. 10/667,639 filed Sep. 22, 2003, entitled “Determining Fluid Chemistry of Formation Fluid by Downhole Reagent Injection Spectral Analysis” (incorporated by reference herein in its entirety) is a preferred implementation of the present reagent mixture.

[0076] One non-limiting embodiment of the present invention, as shown in FIG. 10, is a wireline formation tester 1015, including fluids analyzer 1020. The formation tester is shown downhole within borehole 1012 of formation 1010 suspended by logging cable 1017. Logging cable 1017 also couples the formation tester to surface system 1018. Fluids analyzer 1020 is located within formation tester 1015. Means for extracting fluid from the formation, in this case a probe 1021, is shown extending from the formation tester 1015. Major elements of fluids analyzer 1020 are fluid flow-line 1030, reagent container 1031, and spectral analyzer 1041. This embodiment further uses a flow-line pump (dual chamber piston pump) 1051 and main pump-out line 1061. It is noted that this figure is intended to depict a non-limiting embodiment useful for deploying the present invention. Other suitable elements may be included as dependent upon the specific application. For example, other configurations may be used to extract fluids from the formation, such as in a producing well or a monitoring well where a pump is used to obtain fluid samples. Accordingly, while FIG. 10 depicts a wireline application, the present invention may be deployed in other scenarios, such as permanent installations or a drilling environment.

[0077] While the invention has been described herein with reference to certain examples and embodiments, it will be evident that various modifications and changes may be made to the embodiments described above without departing from the scope and spirit of the invention as set forth in the claims 

What is claimed is:
 1. A fluids analyzer for determining the pH of formation fluid in a region of earth formation surrounding a borehole, comprised of: a reagent container having a mixture of two or more reagents wherein said reagent mixture is capable of detecting a pH range broader than each reagent individually; and means for mixing formation fluid with said reagent mixture downhole.
 2. The fluids analyzer of claim 1, further comprised of: spectral analyzer means, coupled to receive a mixture of formation fluid and reagent mixture from said mixing means for analyzing the optical density of said mixture of formation fluid and reagent mixture in two or more spectral channels.
 3. The fluids analyzer of claim 1, wherein the reagent mixture is capable of measuring pH to an accuracy of about 0.5 units or better.
 4. The fluids analyzer of claim 1, wherein said reagents show similar direction of spectral shift with changes in pH.
 5. The fluids analyzer of claim 2, wherein said two or more spectral channels have bandwidths of approximately 10-20 nm.
 6. A fluids analyzer for determining the pH of formation fluid in a region of earth formation surrounding a borehole, comprised of: a reagent container having a mixture of two or more reagents wherein said reagent mixture is capable of detecting pH at a higher accuracy than each reagent individually; and means for mixing formation fluid with said reagent mixture downhole.
 7. The fluids analyzer of claim 6, further comprised of: spectral analyzer means, coupled to receive a mixture of formation fluid and reagent mixture from said mixing means for analyzing the optical density of said mixture of formation fluid and reagent mixture in two or more spectral channels.
 8. The fluids analyzer of claim 6, wherein said reagents show similar direction of spectral shift with changes in pH.
 9. The fluids analyzer of claim 7, wherein said two or more spectral channels have bandwidths of approximately 10-20 nm.
 10. A method of making a reagent mixture for determining the pH of a sample comprising: a. identifying a target pH range; b. mixing known relative quantities of two or more reagents to create a reagent mixture, wherein said reagent mixture is capable of detecting a pH range broader than each reagent individually; c. optimizing said reagent mixture to identify one or more sets of reagents that satisfy the targeted pH range; and d. characterizing at least one set of reagents.
 11. The method of claim 10, wherein optimizing said reagent mixture includes identifying one or more sets of reagents based on the thermodynamic acid dissociation constants of said reagents.
 12. The method of claim 10, wherein optimizing said reagent mixture includes identifying optimal relative quantities of said reagents.
 13. The method of claim 10, wherein optimizing said reagent mixture includes identifying two or more optimal spectral channels.
 14. The method of claim 10, wherein characterizing at least one of said one or more sets of reagents includes developing a relationship between optical density ratio and pH.
 15. The method of claim 14, further comprising checking for a unique correlation between optical density ratio and pH.
 16. The method of claim 10, wherein characterizing at least one of said one or more sets of reagents includes performing an error analysis.
 17. The method of claim 10, wherein optimizing said reagent mixture includes developing a forward model based on the thermodynamic acid dissociation constants of the reagents, relative quantities of the reagents, and two or more spectral channels wherein said reagents have elevated optical densities.
 18. The method of claim 17, further comprising developing an algorithm based on said forward model to identify one or more sets of reagents having optimal thermodynamic acid dissociation constants.
 19. The method of claim 18, further comprising analyzing the forward model using the optimal thermodynamic acid dissociation constants of the reagents, relative quantities of the reagents, and two or more spectral channels wherein said reagents have elevated optical densities.
 20. The method of claim 19, further comprising developing an algorithm based on said forward model to identify one or more sets of reagents having optimal relative quantities of reagents.
 21. The method of claim 20, further comprising analyzing the forward model using the optimal thermodynamic acid dissociation constants of the reagents, the optimal relative quantities of the reagents, and two or more spectral channels wherein said reagents have elevated optical densities.
 22. The method of claim 21, further comprising developing an algorithm based on said forward model to identify one or more sets of reagents having two or more optimal spectral channels.
 23. The method of claim 22, wherein characterizing at least one of said one or more sets of reagents includes developing a relationship between optical density ratio and pH.
 24. The method of claim 23, further comprising checking for a unique correlation between optical density ratio and pH.
 25. The method of claim 24, wherein characterizing at least one of said one or more sets of reagents includes performing an error analysis.
 26. The method of claim 25, further comprising optimizing absolute concentration of the reagent mixture.
 27. A method of making a reagent mixture for determining the pH of a sample comprising: a. identifying a target pH range; b. mixing known relative quantities of two or more reagents to create a reagent mixture, wherein said reagent mixture is capable of detecting pH at a higher accuracy than each reagent individually; c. optimizing said reagent mixture to identify one or more sets of reagents that satisfy the targeted pH range; and d. characterizing at least one set of reagents.
 28. The method of claim 25, wherein optimizing said reagent mixture includes identifying one or more sets of reagents based on the thermodynamic acid dissociation constants of said reagents.
 29. The method of claim 25, wherein optimizing said reagent mixture includes identifying optimal relative quantities of said reagents.
 30. The method of claim 25, wherein optimizing said reagent mixture includes identifying two or more optimal spectral channels.
 31. The method of claim 27, wherein characterizing at least one of said one or more sets of reagents includes developing a relationship between optical density ratio and pH.
 32. The method of claim 31, further comprising checking for a unique correlation between optical density ratio and pH.
 33. The method of claim 27, wherein characterizing at least one of said one or more sets of reagents includes performing an error analysis.
 34. The method of claim 27, wherein optimizing said reagent mixture includes developing a forward model based on the thermodynamic acid dissociation constants of the reagents, relative quantities of the reagents, and two or more spectral channels wherein said reagents have elevated optical densities.
 35. The method of claim 34, further comprising developing an algorithm based on said forward model to identify one or more sets of reagents having optimal thermodynamic acid dissociation constants.
 36. The method of claim 35, further comprising analyzing the forward model using the optimal thermodynamic acid dissociation constants of the reagents, relative quantities of the reagents, and two or more spectral channels wherein said reagents have elevated optical densities.
 37. The method of claim 36, further comprising developing an algorithm based on said forward model to identify one or more sets of reagents having optimal relative quantities of reagents.
 38. The method of claim 37, further comprising analyzing the forward model using the optimal thermodynamic acid dissociation constants of the reagents, the optimal relative quantities of the reagents, and two or more spectral channels wherein said reagents have elevated optical densities.
 39. The method of claim 38, further comprising developing an algorithm based on said forward model to identify one or more sets of reagents having two or more optimal spectral channels.
 40. The method of claim 39, wherein characterizing at least one of said one or more sets of reagents includes developing a relationship between optical density ratio and pH.
 41. The method of claim 40, further comprising checking for a unique correlation between optical density ratio and pH.
 42. The method of claim 39, wherein characterizing at least one of said one or more sets of reagents includes performing an error analysis.
 43. The method of claim 42, further comprising optimizing absolute concentration of the reagent mixture.
 44. A method for determining the pH of formation fluid in a region of earth formation surrounding a borehole, comprising: a. storing a reagent mixture in a reagent container coupled to a fluids analyzer, wherein said reagent mixture is capable of detecting a pH range broader than each reagent individually; b. positioning the fluids analyzer downhole; c. drawing formation fluid into the fluids analyzer; d. mixing formation fluid with the reagent mixture; and e. analyzing the optical density of said mixture of formation fluid and reagent mixture in one or more spectral channels to determine the pH of the formation fluid.
 45. The method of claim 44, wherein said pH is determined to an accuracy of 0.5 pH units or less.
 46. The method of claim 44, wherein analyzing the optical density is performed using one channel and includes determining the absolute concentration of the reagent mixture.
 47. The method of claim 44 wherein analyzing the optical density is performed using two or more channels.
 48. The method of claim 47, further comprising analyzing the optical density ratio.
 49. The method of claim 44, comprising obtaining optical measurements in three or more channels and performing a regression analysis using said optical measurements.
 50. A method for determining the pH of formation fluid in a region of earth formation surrounding a borehole, comprising: a. storing a reagent mixture in a reagent container coupled to a fluids analyzer, wherein said reagent mixture is capable of detecting pH at a higher accuracy than each reagent individually; b. positioning the fluids analyzer downhole; c. drawing formation fluid into the fluids analyzer; d. mixing formation fluid with the reagent mixture; and e. analyzing the optical density of said mixture of formation fluid and reagent mixture in one or more spectral channels to determine the pH of the formation fluid.
 51. The method of claim 50, wherein said pH is determined to an accuracy of 0.5 pH units or less.
 52. The method of claim 50, wherein analyzing the optical density is performed using one channel and includes determining the absolute concentration of the reagent mixture.
 53. The method of claim 50 wherein analyzing the optical density is performed using two or more channels.
 54. The method of claim 53, further comprising analyzing the optical density ratio.
 55. The method of claim 50, comprising obtaining optical measurements in three or more channels and performing a regression analysis using said optical measurements. 